
/**
 * Contains information regarding a cell. 
 * This includes cell data, its current state and validity of content
 */
public class Cell
{
	private boolean isHover;
	private boolean isClicked;
	private boolean isLocked;
	private boolean isHighlighted;
	private boolean isError;
	private int data;	
	/**
	 * Creates a cell given the following conditions
	 * @param isHover boolean variable to control features on mouse over
	 * @param isClicked boolean variable indicating cell selection
	 * @param isLocked boolean variable preventing user change
	 * @param isHighlighted boolean variable for cell colour change at end game
	 * @param data integer 1-9 held by the cell 
	 */
	public Cell(boolean isHover, boolean isClicked, boolean isLocked, boolean isHighlighted, int data) {
		super();
		this.isHover = isHover;
		this.isClicked = isClicked;
		this.isLocked = isLocked;
		this.data = data;
	}	
	/**
	 * @return isError boolean variable on cell content legality
	 */
	public boolean isError() {
		return isError;
	}
	/**
	 * Sets legal state of a cell based on a legal check
	 * @param isError boolean status of cell legality
	 */
	public void setError(boolean isError) {
		this.isError = isError;
	}
	/* 
	 * Creates a copy of a cell for processing
	 */
	@Override
	protected Object clone()
	{
		return (Object)(new Cell(isHover, isClicked, isLocked, isHighlighted, data));
	}	
	/**
	 * @return isLocked boolean status of whether the cell is locked from user
	 */
	public boolean isLocked() {
		return isLocked;
	}
	/**
	 * @param isLocked status of cell availability to user modification
	 */
	public void setLocked(boolean isLocked) {
		this.isLocked = isLocked;
	}
	/**
	 * @return status if mouse cursor is over cell or not
	 */
	public boolean isHover() {
		return isHover;
	}
	/**
	 * @param isHover if mouse cursor is over cell or not
	 */
	public void setHover(boolean isHover) {
		this.isHover = isHover;
	}
	/**
	 * @return status if cell is clicked or not
	 */
	public boolean isClicked() {
		return isClicked;
	}
	/**
	 * @param isClicked status of cell, clicked or not
	 */
	public void setClicked(boolean isClicked) {
		this.isClicked = isClicked;
	}
	/**
	 * @return data int contained by the cell
	 */
	public int getData() {
		return data;
	}
	/**
	 * @param data int to write to cell
	 */
	public void setData(int data) {
		this.data = data;
	}
	/**
	 * @return isHighlighted cell state for end game highlighting
	 */
	public boolean isHighlighted() {
		return isHighlighted;
	}
	/**
	 * @param isHighlighted cell state for end game highlighting
	 */
	public void setHighlighted(boolean isHighlighted) {
		this.isHighlighted = isHighlighted;
	}
}
